import {
  CHANGE_SELECTKEYS,
  CHANGE_OPENKEYS
} from '../mutation-types'

const menu = {
  state: {
    count: 0,
    selectedKeys: [],
    openKeys: [],
  },
  mutations: {
    [CHANGE_SELECTKEYS] (state, data) {
      state.selectedKeys = data
    },
    [CHANGE_OPENKEYS] (state, data) {
      state.openKeys = data
    }
  },
  actions: {
    changeSelectKeys ({ commit }, data) {
      commit(CHANGE_SELECTKEYS, data)
    },
    changeOpenKeys ({ commit }, data) {
      commit(CHANGE_OPENKEYS, data)
    }
  }
}
export default menu